home *** CD-ROM | disk | FTP | other *** search
- /*________________________________________________________
-
- File: Extension.h
-
- C header file for a printing extension.
-
- Dave Hersey
- Apple Developer Technical Support
-
- 12/01/92 - dmh - Created.
- 4/26/93 - dmh - Updated to use recommended approach
- to global data initialization.
- 9/05/93 - dmh - Updated for b2.
- - Fixed minor problem with highlighting
- of editText panel items.
- - Switched to Exception.h assertion stuff
- for error checking.
- 12/18/93 - dmh - Updated for b3.
- 3/22/94 - dmh - Updated for b4.
- 6/10/94 - dmh - Added GXPRINTINGDISPATCH examples.
- 6/14/96 - cn - Updated to support Universal Interfaces 2.1.
-
- (Note: labels are in the Mark menu.)
-
- __________________________________________________________*/
-
- #include <Types.h>
- #include <Errors.h>
- #include <Resources.h>
- #include <ToolUtils.h>
- #include <GXExceptions.h>
- #include <Collections.h>
- #include <GXMessages.h>
- #include <GXPrinting.h>
-
-
- #define kCreator 'GMUL' /* Our creator type. */
- #define kExtensionCollectionType kCreator /* The collection type we use. */
-
- #define r_ExtensionPanel 6000 /* The ID of our dialog panel. */
- #define kExtensionTurnedOff 0 /* We're turned on. */
- #define kExtensionTurnedOn 1 /* We're turned off. */
-
- #define kDefaultSetting kExtensionTurnedOn /* We're on by default. */
-
-
- typedef struct ExtensionCollection /* This is our collection type. */
- {
- char extTurnedOn; /* On/off panel item value. */
- char fillByte;
- } ExtensionCollection;
-
-
- // Prototypes:
-
- extern long A5Size (void); /* We need these to set up */
- extern void A5Init (void *); /* our A5 world. */
-
- OSErr InitGlobalData(void);
- OSErr NewInitialize(void);
- OSErr NewShutDown(void);
- OSErr NewSpoolPage(gxSpoolFile spFile, gxFormat aFormat, gxShape pgShape);
- OSErr NewJobPrintDialog(gxDialogResult *dlogResult);
- OSErr NewHandlePanelEvent(gxPanelInfoRecord *panelInfo);
-
-
- // GXPRINTINGDISPATCH examples. Note these routines must return an OSErr result.
- // Two routines are "dispatched," both residing in 'pext' segment #1.
-
- #ifdef SECOND_SEG
-
- OSErr SetUpPrintPanel(void);
-
- OSErr GetJobCollectionItem(void *collectItem, long *collectSize,
- OSType collectType, short collectID);
-
- #else
-
- // extern OSErr GXPrintingDispatch(long selector, ...)
- // SIXWORDINLINE(0x221F, 0x203C, 0x0001, 0x0000, 0xABFE, 0x598F);
-
- /*
- OSErr SetUpPrintPanel(void)
- = GXPrintingDispatch(1, 1);
-
- OSErr GetJobCollectionItem(void *collectItem, long *collectSize,
- OSType collectType, short collectID)
- = GXPrintingDispatch(1, 2);
- */
-
- OSErr SetUpPrintPanel(void)
- {
- return GXPrintingDispatch(1);
- };
-
- OSErr GetJobCollectionItem(void *collectItem, long *collectSize,
- OSType collectType, short collectID)
- {
- return GXPrintingDispatch(2, collectItem, collectSize, collectType, collectID);
- };
-
- #endif SECOND_SEG
-